package com.taobao.txc.common.context;

import com.taobao.txc.common.LoggerInit;
import com.taobao.txc.common.LoggerWrap;
import com.taobao.txc.common.util.serviceloader.a;

public class d
{
  private static final LoggerWrap a = LoggerInit.logger;
  private static ITxcContextOperate b = null;
  
  public static String a(String paramString)
  {
    return b.getUserData(paramString);
  }
  
  public static String a(String paramString1, String paramString2)
  {
    if (a.c()) {
      a.debug(String.format("[Thread:%d] set Thread Context [%s:%s]", new Object[] { Long.valueOf(Thread.currentThread().getId()), paramString1, paramString2 }));
    }
    return b.putUserData(paramString1, paramString2);
  }
  
  public static String b(String paramString)
  {
    if (a.c()) {
      a.debug(String.format("[Thread:%d] del Thread Context [%s]", new Object[] { Long.valueOf(Thread.currentThread().getId()), paramString }));
    }
    return b.removeUserData(paramString);
  }
  
  static
  {
    b = (ITxcContextOperate)a.a(ITxcContextOperate.class);
    if ((b != null) && (b.a()))
    {
      a.info("EnhancedServiceLoader load txcContext engine:" + b.getClass());
    }
    else
    {
      a.warn("EnhancedServiceLoader load txcContext engine error, use default.");
      b = new TxcContextOperateByThreadLocal();
    }
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.common.context.d
 * JD-Core Version:    0.7.0.1
 */